package com.yuliang.ai.controller;

import com.yuliang.ai.domain.Dto.ScenicWithFilterDto;
import com.yuliang.ai.domain.Dto.TourCommonDto;
import com.yuliang.ai.domain.Vo.ScenicDetailWithSkusAndPriceVo;
import com.yuliang.ai.domain.Vo.ScenicWithFilterVo;
import com.yuliang.ai.service.ScenicService;
import com.yuliang.utils.result.ResultUtils;
import com.yuliang.utils.result.emums.HttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Huangkai
 */
@Slf4j
@RestController
@RequestMapping("/scenic")
public class ScenicController {
    @Autowired
    ScenicService scenicService;

    @GetMapping(value = "/selectScenicList")
    public String selectScenicList() {
        return scenicService.selectScenicList();
    }

    @PostMapping(value = "/selectScenicWithFilter")
    public String selectScenicWithFilter(@RequestBody ScenicWithFilterVo scenicWithFilterVo) {
        TourCommonDto tourCommonDto = scenicService.selectScenicWithFilter(scenicWithFilterVo);
        if(tourCommonDto != null){
            return ResultUtils.ResultWithMessageDataEnum(HttpCodeEnum.select_success, tourCommonDto);
        }
        return ResultUtils.ResultWithMessageEnum(HttpCodeEnum.data_not_exist);
    }
    @PostMapping(value = "/getScenicDetailWithSkusAndPrice")
    public String getScenicDetailWithSkusAndPrice(@RequestBody ScenicDetailWithSkusAndPriceVo scenicDetailWithSkusAndPriceVo) {
        return scenicService.getScenicDetailWithSkusAndPrice(scenicDetailWithSkusAndPriceVo);
    }
}
